<?
require_once  '../classes/ConnectionDB.php';
require_once  '../classes/ClasseDataManager.php';
require_once  '../classes/TestDataManager.php';
require_once  '../bean/Domanda.php';

$connection =ConnectionDB::getInstance()->connectToDB();

$codiceTest = $_POST["codiceTest"];
$key = $_POST["key"];

$studenti = TestDataManager::getInstance()->getStudentiTest($connection, $codiceTest, $key);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Nuova sottomissione Test Pdf - step 2 - </title>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/prototype.js" type="text/javascript"></script>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/scriptaculous/effects.js" type="text/javascript"></script>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/glassbox/glassbox.js" type="text/javascript"></script>
        <style type="text/css">
            @import url("../css/style.css");
            table{
                width: 100%;
            }

            #tableResults td{
                text-align: center;
            }

             #results {
                padding-top: 3%;
                margin-left: -5px;
            }

            

        </style>
        <script type="text/javascript">
            path_to_root_dir = "../glassboxLatest/glassbox.2.0.0/";
            var listaDomande;
            var numItem=10;
            var currentIndex=0;

            window.onload = function()
            {
                var testForm = new GlassBox();
                testForm.init( 'results', '1040px', '490px', 'auto','',true, false);
                testForm.ipos();
                testForm.appear();
            }


        </script>
    </head>
    <body>
        <?php include '../portal/header.php';?>
        <center>
            <div id="results">
                <div id="resultsCont">
                    <form method="POST" action="reportPdfLiveTest_2.php">

                        <table border='1' id='tableResults' cellpadding='5'>
                            <tr>
                                <th>Codice studente : </th>
                                <th>Nome</th>
                                <th>Cognome</th>
                                <th>Registra risultati</th>
                            </tr>
                            <?for($i=0;$i<count($studenti);$i++)
                            {?>
                            <tr>
                                <td><?= $studenti[$i]->getCodiceStudente(); ?></td>
                                <td><?= $studenti[$i]->getNome(); ?></td>
                                <td><?= $studenti[$i]->getCognome(); ?></td>
                                <td><a href="reportPdfLiveTest_3.php?chiaveTest=<?= $key?>&codiceTest=<?= $codiceTest ?>&codiceStudente=<?= $studenti[$i]->getCodiceStudente(); ?>"><img src='../images/icons/PNG/Pen 2.png' height='30' width='30' title='Registra risultati studente' border='0'/></a></td>

                            </tr>
                                <?}?>


                        </table>
                    </form>
                </div>
            </div>
        </center>
    </body>
</html>
